Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Hawakening support #648

Merged
merged 9 commits into from
Oct 12, 2024

Conversation

RattleSN4K3
Copy link
Contributor

@RattleSN4K3 RattleSN4K3 commented Oct 4, 2024

Adds support for Hawakening, using master server

Query single server

Setup:

GameDig.query({
  type: 'hawakening',
  username: '[email protected]',
  password: 'mypassword',
  // token: ...,
  serverId: '0d788e64-df30-4705-8240-473e6c5ea134'
Example response
{
  "name": "la2-tdm-2",
  "map": "VS-Andromeda",
  "password": false,
  "raw": {
    "listing": {
      "userGuid": "",
      "AllowedRoles": [],
      "DeveloperData": {
        "AveragePilotLevel": "0",
        "MatchState": "1",
        "bIgnoreMMR": "0",
        "bTournament": "0"
      },
      "Endpoint": null,
      "GameType": "HawkenTDM",
      "GameVersion": "-1415111425",
      "IsMatchmakingVisible": true,
      "IsPublicVisible": true,
      "LastUpdate": "2024-10-04T02:56:34.2755953Z",
      "Map": "VS-Andromeda",
      "MatchCompletionPercent": 0,
      "MatchId": "5EA23DC743D3DF2687B004A3C191453C",
      "MaxUsers": 12,
      "MinUsers": 0,
      "Port": null,
      "Region": "North-America",
      "ServerName": "la2-tdm-2",
      "ServerRanking": 0,
      "ServerScore": "0",
      "Status": 1,
      "Users": [],
      "VoiceChannelListing": "",
      "Guid": "0d788e64-df30-4705-8240-473e6c5ea134"
    },
    "info": {
      "AssignedServerGuid": "0d788e64-df30-4705-8240-473e6c5ea134",
      "AssignedServerIp": "66.165.238.194",
      "AssignedServerPort": 7778,
      "GameType": null,
      "GameVersion": "-1415111425",
      "LastUpdated": "2024-10-02T20:23:18.571Z",
      "OwnerGuid": "20000000-0000-0000-0000-000000000000",
      "PartyGuid": "00000000-0000-0000-0000-000000000000",
      "ReadyToDeliver": true,
      "Region": "North-America",
      "RequestedMaps": "",
      "RequestedServerGuid": "0d788e64-df30-4705-8240-473e6c5ea134",
      "SkillRatingAverage": 25,
      "SkillRatingExpansionRate": 0,
      "SkillRatingSearchMax": 0,
      "SkillRatingSearchMin": 0,
      "Status": 1,
      "TimeCreated": "2024-10-02T20:23:18.571Z",
      "Users": [
        "20000000-0000-0000-0000-000000000000"
      ],
      "Guid": "4cd6bb74-fe73-417f-bb4d-5fe94f6fb433"
    }
  },
  "version": "-1415111425",
  "maxplayers": 12,
  "numplayers": 0,
  "players": [],
  "bots": [],
  "queryPort": 27015,
  "connect": "66.165.238.194:7778",
  "ping": 0
}

Query and receive master list

Username, password and token can be omitted.

Setup:

GameDig.query({
  type: 'protocol-hawakeningmaster'
  username: '[email protected]',
  password: 'mypassword',
  // token: ...,
Example response
{
  "name": "",
  "map": "",
  "password": false,
  "raw": {
    "servers": [
      {
        "name": "singapore-sg-1",
        "map": "VS-Valkirie",
        "password": false,
        "raw": {
          "listing": {
            "userGuid": "",
            "AllowedRoles": [],
            "DeveloperData": {
              "AveragePilotLevel": "0",
              "MatchState": "1",
              "bIgnoreMMR": "0",
              "bTournament": "0"
            },
            "Endpoint": null,
            "GameType": "HawkenSG",
            "GameVersion": "-1415111425",
            "IsMatchmakingVisible": true,
            "IsPublicVisible": true,
            "LastUpdate": "2024-10-04T02:38:09.9513906Z",
            "Map": "VS-Valkirie",
            "MatchCompletionPercent": 0,
            "MatchId": "3ABC8BCE4F12CDD4FA755D9EFD85AAEC",
            "MaxUsers": 12,
            "MinUsers": 0,
            "Port": null,
            "Region": "Asia",
            "ServerName": "singapore-sg-1",
            "ServerRanking": 0,
            "ServerScore": "0",
            "Status": 1,
            "Users": [],
            "VoiceChannelListing": "",
            "Guid": "cb740ffd-4eb6-4725-9faa-9a9278e73273"
          }
        },
        "version": "-1415111425",
        "maxplayers": 12,
        "numplayers": 0,
        "players": [],
        "bots": [],
        "queryPort": 0
      },
      {
        "name": "london-tdm-1",
        "map": "VS-Alleys",
        "password": false,
        "raw": {
          "listing": {
            "userGuid": "",
            "AllowedRoles": [],
            "DeveloperData": {
              "AveragePilotLevel": "0",
              "MatchState": "1",
              "bIgnoreMMR": "0",
              "bTournament": "0"
            },
            "Endpoint": null,
            "GameType": "HawkenTDM",
            "GameVersion": "-1415111425",
            "IsMatchmakingVisible": true,
            "IsPublicVisible": true,
            "LastUpdate": "2024-10-04T02:38:10.0634747Z",
            "Map": "VS-Alleys",
            "MatchCompletionPercent": 0,
            "MatchId": "FFD578304865EBC1605FA88D8A925FF5",
            "MaxUsers": 12,
            "MinUsers": 0,
            "Port": null,
            "Region": "Europe",
            "ServerName": "london-tdm-1",
            "ServerRanking": 0,
            "ServerScore": "0",
            "Status": 1,
            "Users": [],
            "VoiceChannelListing": "",
            "Guid": "37f887f8-3fbe-4e32-aa99-cff222da359f"
          }
        },
        "version": "-1415111425",
        "maxplayers": 12,
        "numplayers": 0,
        "players": [],
        "bots": [],
        "queryPort": 0
      }
    ]
  },
  "version": "",
  "maxplayers": 0,
  "numplayers": 0,
  "players": [],
  "bots": [],
  "connect": "undefined:undefined",
  "ping": 0
}

@RattleSN4K3
Copy link
Contributor Author

Before approving this PR...

I noticed the master query works without a client authorization. I want to adjust that prior to merging.

@RattleSN4K3
Copy link
Contributor Author

Updated. Should be final for now.

@CosminPerRam CosminPerRam merged commit d2397b6 into gamedig:master Oct 12, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants